﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TaiLieu;

public partial class Member : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Member_1();
    }
    protected void LoadControlCenter(string path)
    {
        this.pnContext.Controls.Clear();
        this.pnContext.Controls.Add(LoadControl(path));
    }
    public void Member_1()
    {
        switch (QueryHelper.Get_Value(Request, 2))
        {
            case "login":
                LoadControlCenter("login.ascx");
                break;
            case "register":
                LoadControlCenter("register.ascx");
                break;
            case "infomation-user":
                LoadControlCenter("infomationUser.ascx");
                break;
            case "logout":
                Sessions.members = null;
                DeleteCookie();
                Response.Redirect("default.aspx?/trang-chu");
                break;
            case "quen-mat-khau":
                LoadControlCenter("quenmatkhau.ascx");
                break;
            case "thongbao":
                LoadControlCenter("ThongBao.ascx");
                break;
        }
    }
    protected void DeleteCookie()
    {
        HttpCookie cookie = new HttpCookie("remember", "yes");
        Response.Cookies.Add(cookie);
        cookie = new HttpCookie("idmembergiaoducanbinh");
        cookie.Values.Add("UserName", "");
        cookie.Values.Add("Password", "");
        Response.Cookies.Add(cookie);
    }
}